<?php
namespace Tbf\Bundle\PackageBundle\TreePackage;
abstract class AbstractTreeEntity
{
    abstract public function setParent($entity);
    abstract public function getParent();
    abstract public function getId();
    public function getPid()
    {
        $parent = $this->getParent();
        if (!empty($parent)) {
            $pid = $parent->getId();
        } else {
            $pid = 0;
        }

        return $pid;
    }
}
